import pandas as pd
import pymysql
from flask import Flask, render_template
import utils


def info():
    df = pd.read_csv("data/房源数量占比.csv")
    df = df.sort_values("房源数量分布占比")
    pro = df['省份'].tolist()
    rank = df['房源数量分布占比'].tolist()
    return pro, rank


app = Flask(__name__)
picl = info()


@app.route("/")
def index():
    # 渲染模板的同时将数据传输进去
    return render_template("房源分布折线图.html", picl=picl)


if __name__ == '__main__':
    app.run(debug=True)
